﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace eService.Presentation
{
    public class Grid : DataGridView
    {
        protected override bool ProcessDialogKey(Keys keyData)
        {
            bool result;
            if (keyData == Keys.Return)
            {
                DataGridViewCell currentCell = base.CurrentCell;
                base.ProcessDialogKey(keyData);
                base.CurrentCell = currentCell;
                result = true;
            }
            else
            {
                result = base.ProcessDialogKey(keyData);
            }
            return result;
        }
        protected override bool ProcessDataGridViewKey(KeyEventArgs e)
        {
            return e.KeyCode == Keys.Return || base.ProcessDataGridViewKey(e);
        }
    }
}
